<?php
namespace Common\Model;
use Think\Model;

/**
 * Class DeviceFixModel
 * @package Common\Model
 * 设备维修记录
 */
class DeviceFixModel extends BaseModel{
    public $pix = "";
    public $fieldsStr = '*';
    public $orderStr = 'status asc,date desc';

    public function get_list_use_page($map=array(), $cur_page, $rows_num){
        $map = filter_query_map($map);
        $count = $this->where($map)->count();
        $list = $this->where($map)->order($this->orderStr)->page($cur_page.",$rows_num")->select();
        foreach($list as $k => $v){
            $list[$k]['status_text'] = fix_status($v['status'], false);
        }
        return array('total'=>$count, 'list'=>$list, 'map'=>$map);
    }
}